import { Table, Button, Space, Divider } from 'ant-design-vue';
import { format } from '@/utils/format'

export const tableSchemas = [
  {
    title: '编号',
    dataIndex: 'id',
    key: 'id',
    align: 'center',
    width: 80,
  },
  {
    title: '手机号',
    dataIndex: 'phone',
    key: 'phone',
    align: 'center',
    inSearch: true
  },
  {
    title: '昵称',
    dataIndex: 'nickName',
    key: 'nickName',
    align: 'center',
    inSearch: true
  },
  {
    title: '真实姓名',
    dataIndex: 'realName',
    key: 'realName',
    align: 'center',
    inSearch: true
  },
  {
    title: '性别',
    dataIndex: 'gender',
    key: 'gender',
    align: 'center',
    inSearch: true,
    customRender({ text, record, index, column }) {
      return text.name;
    }
  },
  {
    title: '年龄',
    dataIndex: 'age',
    key: 'age',
    align: 'center',
    inSearch: true
  },
  {
    title: '头像',
    dataIndex: 'avatar',
    key: 'avatar',
    align: 'center',
  },
  {
    title: '创建时间',
    dataIndex: 'createdTime',
    key: 'createdTime',
    align: 'center',
    customRender({text, record, index, column}) {
      return format(text, 'YYYY-MM-DD HH:mm:ss');
    }
  },
 
];

export const formSchemas = [
  {
    component: 'Input',
    label: 'ID',
    name: 'id',
    dataIndex: 'id',
    vShow: false,
  },
  {
    component: 'InputNumber',
    label: '手机号',
    dataIndex: 'phone',
    name: 'phone',
    
  },
  {
    component: 'Input',
    label: '昵称',
    dataIndex: 'nick_name',
    name: 'nick_name',
  },
  {
    component: 'Input',
    label: '真实姓名',
    dataIndex: 'real_name',
    name: 'real_name',
    
  },
  {
    component: 'InputNumber',
    label: '性别',
    dataIndex: 'gender',
    name: 'gender',
    
  },
  {
    component: 'InputNumber',
    label: '年龄',
    dataIndex: 'age',
    name: 'age',
    
  },
  {
    component: 'Input',
    label: '头像',
    dataIndex: 'avatar',
    name: 'avatar',
  },
  
];
